<?php

namespace app\admin\validate\user;

use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'username' => 'require',
        'password' => 'require',
        'newPassword' => 'require',
        'repeatPassword' => 'require',
        'captcha' => 'require'
    ];
    protected $message = [
        'username.require' => '用户名不能为空',
        'password.require' => '密码不能为空',
        'newPassword.require' => '新密码不能为空',
        'repeatPassword.require' => '确认密码不能为空',
        'captcha.require' => '验证码不能为空'
    ];
    protected $scene = [
        'login' => ['username', 'password', 'captcha'],
        'editPassword' => ['newPassword', 'repeatPassword'],
    ];
}